package com.pig4cloud.pigx.contract.mapstruct;

import com.pig4cloud.pigx.contract.entity.ContractOrder;
import com.pig4cloud.pigx.contract.entity.ContractOrderHistory;
import com.pig4cloud.pigx.contract.open.api.vo.OpenApiOrderVOV1;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * ContractOrderStruct
 *
 * @date 2022/8/12 16:32
 */
@Mapper
public interface ContractOrderHistoryStruct {
    ContractOrderHistoryStruct INSTANCE = Mappers.getMapper(ContractOrderHistoryStruct.class);

    /**
     * ContractOrder转换为ContractOrderHistory
     *
     * @param entity entity
     * @return {@link ContractOrderHistory}
     * @date 2022/7/14 14:21
     */
    ContractOrderHistory entity2History(ContractOrder entity);

    /**
     * ContractOrderHistory转换为ContractOrder
     *
     * @param history history
     * @return {@link ContractOrder}
     * @date 2022/7/14 14:21
     */
    ContractOrder history2Entity(ContractOrderHistory history);

    /**
     * ContractOrderHistory -> OpenApiOrderVOV1
     *
     * @param history entity
     * @return {@link OpenApiOrderVOV1}
     * @date 2022/7/14 14:21
     */
    OpenApiOrderVOV1 history2ApiVOV1(ContractOrderHistory history);
}
